package com.imooc.miaosha.controller;

import com.imooc.miaosha.pojo.ApiResultTo;
import com.imooc.miaosha.rabbitmq.MqSender;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class MqController {
    @Autowired
    MqSender sender;

    @RequestMapping(value = "/mq",method = RequestMethod.POST)
    public ApiResultTo<?> testMq(){
        sender.send("hello mq!");
        return ApiResultTo.buildSuccess("OK");
    }
}
